package com.wu01.demo.mapper;

import com.wu01.demo.Entity.User;
import lombok.Data;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserMapper{

//    @Select("select * from user where id = #{id}")
    public User getUserById(Integer id);
    @Update("update user set username=#{username} where id = #{id}")
    public int updateUser(User user);

    @Select("select * from user where username = #{username}")
    User getUserByUsername(String s);


//    @Delete("dele")
//    User deleteUser(User user);
//
//    @Delete("delete from user where id = #{id}")
//    public int deleteUserById(Integer id);
//
////    @Options(useGeneratedKeys = true,keyProperty = "id")
//    @Insert("insert into user(username,password) values(#{username},#{password})")
//    public int insertUser(User user) ;
//
//    @Update("update user set username = #{username} where id = #{id}")
//    public int updateUsernameById(User user);

}
